////////////////////////////////////////////////////////////////////////////////
//
//  FLEX USER GROUP HOKURIKU
//  Copyright 2009 Flex User Group Hokuriku
//  All Rights Reserved.
// 
//  NOTICE: Flex User Group Hokuriku permits you to use, 
//  modify, and distribute this file 
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
package net.fxug.hokuriku.chocolat.helper
{
    import mx.core.IMXMLObject;
    import mx.events.FlexEvent;

    import net.fxug.hokuriku.chocolat.model.ApplicationDataModel;
    import net.fxug.hokuriku.chocolat.view.VoteScore;

    /**
     * スコア画面のヘルパークラス
     *
     * @author shoito
     */
    public class VoteScoreHelper implements IMXMLObject
    {
        private var view:VoteScore;

        public function initialized(document:Object, id:String):void
        {
            this.view = document as VoteScore;
            this.view.addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
        }

        private function creationCompleteHandler(event:FlexEvent):void
        {
            // FIXME #3の暫定対応
//            this.view.goodScore.text = ApplicationDataModel.getInstance().goodComment;
//            this.view.badScore.text = ApplicationDataModel.getInstance().badComment;
//            this.view.feedback.text = ApplicationDataModel.getInstance().feedback;
            this.view.goodScore.text = ApplicationDataModel.getInstance().getGoodMessage();
            this.view.badScore.text = ApplicationDataModel.getInstance().getBadMessage();
            this.view.feedback.text = ApplicationDataModel.getInstance().getFeedbackMessage();
        }
    }
}